The present invention relates to a method for expressing illumination light by utilizing a computer graphics technique.
In the field of three-dimensional computer graphics used for game image generation or the like, a model disposed in a virtual three-dimensional space defined in accordance with a world coordinate system is expressed by using a combination of polygons, and a variety of textures are mapped on the surface of such polygon, thereby improving a model quality. Such a method is employed in the case of expressing divergence of the illumination light from a light source such as electric bulb. For example, there is attempted an expression method for pasting a substantially cone shaped three-dimensional model that corresponds to a range in which the illumination light diverges is composed of a polygon, and a texture expressing how the illumination light diverges on the surface of that polygon.
However, in a conventional expression method, the three-dimensional model is composed of a polygon, and thus, a burden on image processing increases. Although the processing burden is reduced as long as a planar model is utilized, a change in viewing illumination light according to the position of the light source or a change in optical axis direction cannot be fully expressed, and there is apprehension that the reality of an image is degraded.
The present invention has been made in order to solve the foregoing problem. It is an object of the present invention to provide an image expression method capable of providing an image of more realistic illumination light while reducing the processing burden and a computer program used for achieving the same.
According to an aspect of the present invention, there is provided a method for expressing illumination light from a light source placed in a virtual three-dimensional space by image processing employing a computer, the method comprising the steps of: disposing a plurality of polygons, each of which corresponds to a shape of a transverse cross section at each position of a virtual region that gradually expands with advancement from the light source in an optic axis direction, at respective positions spaced from each other on an optic axis of the light source so that a normal of each polygon is oriented toward a view point set in the virtual three-dimensional space, said respective positions being set in such a manner that at least adjacent polygons are partially superimposed on each other; mapping a texture that expresses divergence of the illumination light to each polygon; changing a size of the virtual region in a direction orthogonal to the optic axis based on a distance from the view point to the light source, and differentiating a magnification of the virtual region to the distance from the light source based on a relationship between the optic axis direction and a direction in which the light source is viewed from the view point.
According to the expression method of the present invention, polygons from the vicinity of the light source are arranged in order from the smallest one along the optic axis direction, and a texture of illumination light is mapped on these polygons, whereby a virtual region in which the illumination light is visualized as if it were divergent is observed from the view point. At the center side of the virtual region, there occurs a change such that the texture mapped on such each polygon is superimposed, the illumination luminance is high, a degree of superimposition of the texture decreases at the periphery, and the luminance is lowered. In this manner, the illumination light can be naturally expressed. Moreover, the processing burden is reduced because polygons being planar graphics are arranged so as to orient the view point instead of forming a complicated three-dimensional model by combining the polygons. The size or magnification of the virtual region is controlled based on a relationship between the distance from the view point or optic axis direction and the direction in which the light source is viewed from the view point. Thus, the range of divergence of the illumination light is changed according to the position of the light source viewed from the view point or change in the optic axis direction, and the reality of an image of illumination light can be fully increased.
In the expression method of the present invention, as a distance from the view point to the light source increases, the virtual region may be expanded in a direction orthogonal to the optic axis. In this case, as the distance from the light source is longer, a phenomenon in which the range of the illumination light is seen to be broadened can be expressed, and the reality of an image is increased more significantly. In particular, as the distance from the view point to the light source increases, in the case where the virtual region is expanded in a direction orthogonal to the optic axis uniformly over the full length of the light axis direction, processing can be simplified, which is preferable.
In the expression method of the present invention, as a relationship between the optic axis direction and the direction in which the light source is viewed from the view point is closer to an orthogonal state, the magnification of the virtual region to the distance from the light source may be set to be smaller. In this case, a difference in view of the luminous flux of illumination light between a case in which the luminous flux ejected to be comparatively narrowly collimated from the light source is viewed laterally and a case when the luminous flux is viewed toward the light source can be fully expressed.
That is, in the former case, the luminous flux is laterally observed, and thus, a degree of expansion of the luminous flux is comparatively small. The collimated luminous flux can be properly expressed by reducing the magnification of the virtual region concurrently. On the other hand, in the latter case, even if the collimated luminous flux is ejected, where the light source is observed in a direction in which the luminous flux advances, the illumination light is visualized as if it were greatly divergent in the vicinity of the light source. Therefore, the magnification of the virtual region is increased, whereby how greatly the illumination light diverges can be properly expressed.
In combination with such a change in magnification, as a relationship between the optic axis direction and the direction in which the light source is viewed from the view point is closer to a parallel state, the number of the polygons may be reduced. If the magnification of the virtual region is large, more polygons gather within a narrow range relevant to the optic axis direction. Thus, even if the number of polygons is reduced, an effect on expression of illumination light is relatively reduced, the number of polygons is reduced without degrading the reality of an image, and the processing burden can be further reduced.
In the image expression method of the present invention, as the distance from the view point to the light source increases, the transparency of each texture maybe increased. In this case, it is possible to express how the luminance of illumination light changes according to the distance from the view point to the light source. In particular, in the case of combination with expansion and reduction of the virtual region according to the distance, it is possible to express how the illumination light gathers within a comparatively narrow range when the light is close to the light source. When the light is distant from the light source, it is possible to express how lightly the illumination light diverges within a comparatively wide range. Therefore, the reality of an image of the illumination light is improved more remarkably.
In such case of changing transparency, a polygon, of which the transparency of the texture to be mapped is greater than a predetermined value may be eliminated from a depicting target. In this case, such a polygon, which cannot be observed even if it is depicting, is eliminated from a depicting target, whereby the processing burden can be reduced.
In the image expression method of the present invention, the texture mapped polygon is disposed at a predetermined reference point associated with the light source as well, whereby the size of the polygon at the reference point maybe changed based on the distance from the view point to the light source. In this case, in addition to the luminous flux of illumination light ejected from the light source, the light diverging in a spherical shape at the periphery of the light source as well can be expressed, and the reality of an image is improved more remarkably.
In addition, if the polygon at the reference point is expanded as the distance from the view point to the light source increases, the divergence of the light at the periphery of the light source is observed to be relatively greater than the luminous flux of ejection light from the light source expressed by a polygon disposed in the virtual region, which is preferable. Further, as the distance from the viewpoint to the light source increases, in the case where the transparency of the polygon at the reference point has been decreased, the divergence of the light in the vicinity of the light source is clearly observed as the distance from the view point to the light source increases. As a result, the reality of an image is improved more remarkably. In particular, in the case of combining a configuration in which the transparency of the texture of the polygon disposed in the virtual region is decreased as the distance increases, when the light source is observed closely, the luminous flux of the illumination light is expressed to be enhanced more. In the case where the light source is observed distantly, the light in the vicinity of the light source can be expressed to be enhanced more. Thus, the visibility of the illumination light according to the distance can be realistically expressed.
A program for expressing illumination light from a light source placed in a virtual three-dimensional space by image processing employing a computer, said program causing a computer to execute: a process for disposing a plurality of polygons, each of which corresponds to a shape of a transverse cross section at each position of a virtual region that gradually expands with advancement from the light source in an optic axis direction, at respective positions spaced from each other on an optic axis of the light source so that a normal of each polygon is oriented toward a view point set in the virtual three-dimensional space; and a process for mapping a texture that expresses divergence of the illumination light to each polygon, wherein, in the disposing process, said respective positions are set in such a manner that at least adjacent polygons are partially superimposed on each other, a size of the virtual region is changed in a direction orthogonal to the optic axis based on a distance from the view point to the light source, and a magnification of the virtual region to the distance from the light source is differentiated based on a relationship between the optic axis and a direction in which the light source is viewed from the view point.
This program is read and executed by a computer, whereby the image expression method of the present invention can be carried out.
The program of the present invention, as described below, can comprise the preferred mode of the above described expression method. That is, the program of the present invention may be configured so as to expand the virtual region in the direction orthogonal to the optic axis as the distance from the view point to the light source increases. The program may be configured so as to expand the virtual region in a direction orthogonal to the optic axis uniformly over the full length of the optic axis direction as the distance from the view point to the light source increases. The program may be configured so as to set the magnification of the virtual region to be smaller relevant to the distance from the light source as a relationship between the optic axis direction and the direction in which the light source is viewed from the view point is closer to an orthogonal state. The program may be configured so as to reduce the number of the polygons as a relationship between the optic axis direction and the direction in which the light source is viewed from the view point is closer to a parallel state. The program may be configured so as to increase the transparency of each texture as the distance from the view point to the light source increases. The program may be configured so as to eliminate from a depicting target a polygon of which the transparency of the texture to be mapped is greater than a predetermined value. The program may be configured so as to dispose the texture mapped polygon at a predetermined reference point associated with the light source as well, and change the size of the polygon at the reference point based on the distance from the view point to the light source. The program may be configured so as to expand the polygon at the reference point as the distance from the view point to the light source increases. The program may be configured so as to decrease the transparency of the polygon at the reference point as the distance from the view point to the light source increases.
Further, the program of the present invention may be provided to a user after recorded in a storage medium or may be provided to a user after loaded on a wired or wireless transmission medium.
The term xe2x80x9cpolygonxe2x80x9d generally denotes a planar graphics or a plane figure having a finite number of vertexes. In the present invention, this term denotes a planar graphics as a minimal unit for configuring an object in computer graphics, and may contain a circle that does not have a vertex. The virtual region may be a cone or frustum shape having a predetermined magnification over its full length or may be variously formed in water drop shape or trumpet shape whose taper rate is not constant. The vertexes of the virtual region may not always be coincident with the light source.